<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>javascript build website</title>
     <link rel="stylesheet" href="http://www.m3958.com/yui/3.5.0pr2/build/cssreset/cssreset.css" type="text/css">
    <link rel="stylesheet" href="http://www.m3958.com/yui/3.5.0pr2/build/cssfonts/cssfonts.css" type="text/css">
<script src="http://www.m3958.com/yui/3.5.0pr2/build/yui/yui-min.js"></script>

<script type="text/javascript">

var m3958_hostname = "http://www.m3958.com/";
(function(){
	var hr = window.location.href;
	if(hr.indexOf('8888') == -1){
		if(hr.indexOf('debug=true') != -1){
			m3958_hostname = 'file:///E:/eclipse-jee-helios-SR1-win32/xyzcms/war/';
		}
	}else{
		m3958_hostname = 'http://127.0.0.1:8888/';
	}
})();

var fireGlobalEvent = function (e, param) {
	  YUI().use('event-custom', function (Y) {
	    var publisher = new Y.EventTarget();
	    publisher.publish(e, {
	      broadcast:  2,   // global notification
	      emitFacade: true // emit a facade so we get the event target
	    }).fire(param);
	  });
};

YUI({combine: true,
	comboBase: m3958_hostname + 'combo/yui?'
}).use("node","frame", function(Y){
	/*
    var frame = new Y.Frame({
        title:"foo",
        container: "#bork",
        content: "<hr/><b>loading</b><hr/>",
        id: "foopynoopy",
        designMode: false,
        use: ['substitute', 'node', 'selector-css3', 'editor-selection', 'stylesheet'],
        name: "yuiframe", //bug: not used?
        extracss: "hr {color: blue;}"
    });
    
    frame.after("ready", function(){
        Y.log("ready");
        
        //modify something inside the frame
        var fi = frame.getInstance();
        fi.one("b").set("innerHTML", "loaded!").setStyle("color", "green"); 
  
        // set a frame attribute
        frame._iframe.setStyle("height", 100);      
    });
    
    frame.render();
    

    Y.one("#test").on("click", function(e){
        var fi = frame.getInstance();
        fi.one("b").set("innerHTML", "clicked").setStyle("color","red");
    });
*/
    Y.Global.on('my_custom_global_event', function (e, param) {
        alert(new Date().getTime() - t.getTime());
     });
    var t = new Date();
    var n = Y.Node.create('<iframe id="hiframe" style="visibility:hidden;display:none" mce_style="visibility: hidden; display: none;" src="./imagetestiframe.html"/> ');
    Y.one('body').append(n);
});
</script>
</head>
<body class="yui3-skin-sam">

<h1>testing Y.Frame</h1>
<div id="bork"></div>
<button id="test">test</button>


</body>
</html>